
"""test data"""

import os
from hashlib import md5
from pypione import Package, PackageFile
pkg_dir = os.path.join(os.path.dirname(__file__), 'packages')

def get_pkg_data(pkg, filename):
    return open(os.path.join(pkg_dir, 
                    pkg, 'dist', filename), 'rb').read()

def teardown_packages():
    for pf in PackageFile.all():
        pf.delete()
    for p in Package.all():
        p.delete()

class foobs_09:
    filename = 'foobs-0.9.9.1.tar.gz'
    data = get_pkg_data('foobs', filename)
    md5_digest = md5(data).hexdigest()

class foobs_1:
    filename = 'foobs-1.0.tar.gz'
    data = get_pkg_data('foobs', filename)
    md5_digest = md5(data).hexdigest()
    
class foobs_1_bdist_egg:
    filename = 'foobs-1.0-py2.4.egg'
    data = get_pkg_data('foobs', filename)
    md5_digest = md5(data).hexdigest()
    
class nost:
    filename = 'nost-0.1.tar.gz'
    data = get_pkg_data('nost', filename)
    md5_digest = md5(data).hexdigest()